<!-- <template>
  <div>
    <h1>hello home</h1>
  </div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style> -->

<template>
  <div class="login-container">
    <el-card class="login-card">
      <div class="login-form">
        <el-form :model="loginForm">
          <!-- 账号密码登录 -->
          <el-form-item label="用户名" prop="username">
            <el-input
              v-model="loginForm.username"
              prefix-icon="el-icon-user"
            ></el-input>
          </el-form-item>
          <el-form-item label="密码" prop="password">
            <el-input
              type="password"
              v-model="loginForm.password"
              prefix-icon="el-icon-lock"
            ></el-input>
          </el-form-item>

          <!-- 验证码登录 -->
          <el-form-item label="验证码" prop="captcha">
            <el-input v-model="loginForm.captcha" prefix-icon="el-icon-message">
              <template #append>
                <el-button>获取验证码</el-button>
              </template>
            </el-input>
          </el-form-item>

          <!-- 微信扫码登录 -->
          <div class="qrcode-login">
            <p>微信扫码登录</p>
            <el-image
              style="width: 100px; height: 100px"
              src="qrcode.png"
            ></el-image>
          </div>

          <el-form-item>
            <el-button type="primary" @click="login">登录</el-button>
          </el-form-item>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'

const loginForm = ref({
  username: '',
  password: '',
  captcha: '',
})

const login = () => {
  // 实现登录逻辑
  ElMessage({
    message: '登录成功',
    type: 'success',
  })
}
</script>

<style scoped>
.login-container {
  display: flex;
  justify-content: flex-end;
  padding: 100px;
}

.login-card {
  width: 500px;
}

.qrcode-login {
  text-align: center;
  margin-top: 20px;
}
</style>
